import React from 'react'
import ReactDOM from 'react-dom/client'
import zhCN from 'antd/es/locale/zh_CN';
import 'antd/dist/antd.less'
import '@/styles/index.scss'
import 'moment/locale/zh-cn';
import { ConfigProvider } from 'antd'
import { Provider } from 'react-redux';
import { HashRouter as Router, Route, Switch } from 'react-router-dom';
import AppLayout from './Layout';
import store from './store';
import withRetry from './components/ErrorBoundary/withRetry'

const LoginView = withRetry(() => import('@/views/LoginViews/LoginView'))
const App = () => (
  <Router>
    <Provider store={store}>
      <ConfigProvider locale={zhCN}>
        <div className="container">
          <Switch>
            <Route path="/login" component={LoginView} />
            <Route path="/" component={AppLayout} />
          </Switch>
        </div>
      </ConfigProvider>
    </Provider>
  </Router>
)
const root = ReactDOM.createRoot(document.querySelector('#root'))
root.render(
  <App />,
)
